package com.moxiao.yfjh.module.blind.dal.mysql.memberlabel;

import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import com.moxiao.yfjh.module.blind.dal.dataobject.memberlabel.MemberLabelDO;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.blind.controller.admin.memberlabel.vo.*;

/**
 * 相亲标签库 Mapper
 *
 * @author mx
 */
@Mapper
public interface MemberLabelMapper extends BaseMapperX<MemberLabelDO> {

    default PageResult<MemberLabelDO> selectPage(MemberLabelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MemberLabelDO>()
                .likeIfPresent(MemberLabelDO::getLabel, reqVO.getLabel())
                .eqIfPresent(MemberLabelDO::getScore, reqVO.getScore())
                .eqIfPresent(MemberLabelDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MemberLabelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MemberLabelDO::getId));
    }

    default List<MemberLabelDO> selectList(MemberLabelExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<MemberLabelDO>()
                .eqIfPresent(MemberLabelDO::getLabel, reqVO.getLabel())
                .eqIfPresent(MemberLabelDO::getScore, reqVO.getScore())
                .eqIfPresent(MemberLabelDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MemberLabelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MemberLabelDO::getId));
    }

}
